import { getDetailApi } from "../../utils/api";
const detailModule = {
  state: {
    detail: [],//详情页
  },
  mutations: {
    getDetail(state, payload) {
      state.detail = payload.result;
    }
  },
  actions: {
    // 详情页
    getDetailAsc({ commit }, payload) {
      return new Promise((resolve) => {
        getDetailApi({ id: payload.id }).then((res) => {
          commit("getDetail", res);
          resolve();
        });
      });
    }
  }
}
export default detailModule;